Win: Add GetHostNameW fallback for win7 using gethostname#150909
Win: Add GetHostNameW fallback for win7 using gethostname#150909Fulgen301 wants to merge 1 commit into
Conversation
|
r? @ChrisDenton rustbot has assigned @ChrisDenton. Use |
|
Reminder, once the PR becomes ready for a review, use |
|
cc @roblabla @PaulDance it would seem a bit silly to merge #150905 then immediately merge this PR. Do you have any thoughts on this PR. |
Yes, this PR obsoletes #150905, and seems like the right approach to me. |
Yes, it is, but I thought doing so would have the advantage of getting a quick and easy fix known to work merged fast while a more comprehensive but complex one would be implemented with ample time concurrently. Considering the above comments, it kind of confirms that. Either way works in the end, though. |
| pub static WS2_32: &CStr = c"ws2_32"; | ||
|
|
||
| #[cfg(target_vendor = "win7")] | ||
| pub fn GetHostNameW(name: PWSTR, namelen: i32) -> i32 { |
There was a problem hiding this comment.
I guess it could be nice to link the original issue somewhere around here.
There was a problem hiding this comment.
Left that out for now - none of the other compat functions have an issue linked to them, and the issue in question was "just" a compatibility issue.
This comment has been minimized.
This comment has been minimized.
|
This now needs to be rebased on top of #150905. Some its changes need to be integrated or reverted:
|
|
@Fulgen301 Hi, ping from triage team. This PR has been inactive for a while. There are still some review comments that need to be addressed. Would you like to proceed with this PR? Thanks. |
3e2e73c to
97f86fc
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@SpriteOvO really sorry it took so long, I implemented the requested changes. |
759dad1 to
68fa86f
Compare
68fa86f to
75cb22e
Compare
View all comments
GetHostNameWis only available starting with Windows 8, butgethostnamehas been available since Windows Vista. Use it as a fallback and convert the result from ANSI to Unicode.Fixes #150896
This also replaces #150905 - I can rebase it onto the other PR should that one get merged first.